// 引入vue和路由
import Vue from 'vue'
import VueRouter from 'vue-router'
// 自定义组件
import MyLogin from '@/views/Login/MyLogin.vue'
import MyRegister from '@/views/Login/MyRegister.vue'
import MyHome from '@/views/Home/MyHome.vue'
import MyLesson from '@/views/Home/aside/lesson/MyLesson.vue'
import MyMessage from '@/views/Home/aside/message/MyMessage.vue'
import MyClass from '@/views/Home/aside/class/MyClass.vue'
import MyStudent from '@/views/Home/aside/class/MyStudent.vue'
import MyStudentMessage from '@/views/Home/aside/class/MyStudentMessage.vue'
// 注册
Vue.use(VueRouter)
// 后端视图函数路径用path
const routes = [{
  // 默认进入页面
  path: '/',
  component: MyLogin
},
{
  path: '/login',
  component: MyLogin
},
{
  // 注册路径
  path: '/register',
  component: MyRegister
},
{
  // 主页面路径
  path: '/home',
  component: MyHome,
  // 二级路由
  children: [{
    // 课程
    path: '/lesson',
    component: MyLesson
  },
  {
    // 班级
    path: '/class',
    component: MyClass
  },
  {
    // 我的
    path: '/message',
    component: MyMessage
  },
  {
    // 学生
    path: '/student',
    component: MyStudent
  },
  // 学生详情界面
  {
    path: '/studentmessage',
    component: MyStudentMessage
  }

  ]
}
]

const router = new VueRouter({
  routes
})

export default router
